<?php
	if(isset($_REQUEST["tal"])) {
	$tal=$_REQUEST["tal"];	
	echo $tal;	
	}
	session_start();
	if(isset($_SESSION["total"])) {
	$total=$_SESSION["total"];	
	$total=$total+$tal;	
	} else {
	$total=0;	
	}
	
	echo"sum:$total";
	$_SESSION["total"]=$total;
?>

<form action="test.php">
	<input type="text" />
    <input type="submit" />
</form>